<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateCruiseOrderProjectsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('cruise_order_projects_lazy', function (Blueprint $table) {
            $table->id();
            $table->unsignedInteger('cruiseOrderId')->default(0)->comment('cruise_order.id');
            $table->string('positionName', 32)->default('')->comment('位置名称');
            $table->string('field', 64)->default('')->comment('巡检项field');
            $table->string('name', 64)->default('')->comment('巡检项名称');
            $table->string('content', 255)->default('')->comment('项目填写内容');
            $table->string('problemDesc', 255)->default('')->comment('问题描述');
            $table->string('rectifySuggest', 255)->default('')->comment('整改建议');

            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->collation = 'utf8mb4_general_ci';
            $table->comment = 'cruise_order项目展示（后期用脚本同步，不能做实时数据查询）';


            $table->index('cruiseOrderId', 'idx_cruiseOrderId');
            $table->index('createdAt', 'idx_createdAt');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('cruise_order_projects_lazy');
    }
}
